﻿@{
    ViewBag.Title = "Corperation";
    Layout = "~/Areas/Home/Views/Shared/_LeftSubNavLayout.cshtml";
}
@model Phatent.Model.Pages.PageCollection
<style>
    .corSlideItem { width: 100%; background-color: #f4f4f4; }
    .corSlideItem img { width: 230px; height: 140px; }
    .corSlideItem td { padding: 10px; vertical-align:top; }
    
    .corSlideItem p { text-indent: 2em; line-height: 20px; margin-top:10px;}
    .corSlideItem div { color: #e8721b; font-size: 14px; }
    .corSlideItem div span { font-size: 12px; color: #0b63a5; float: right;  }
    .corSlideItem div b {font-size: 14px; }

    .tls { }
    .tls ul { padding: 10px; }
    .tls ul li { height: 35px; line-height: 35px; font-size: 13px; }
    .tls ul li a { color: #666; }
    .tls ul li span { float: right; color: #999; }
    .tls ul li .triangle { clear: both; width: 0px; height: 0px; display: inline-block; _zoom:1;*display:inline; vertical-align:middle; border-bottom: solid 5px transparent; border-top: solid 5px transparent; border-right: solid 5px transparent; border-left: solid 5px #1a5096; margin-right: 10px; }
</style>
<div>
    <div class="t1">
        @if (Phatent.Website.WebContext.Language=="zh"){
            <font>公 司 动 态</font>
            <span>您当前位置：首页 > 新闻中心 > 公司动态</span>
        }else{
            <font>Company News</font>
            <span>Your Location：Home > News > Company News</span>
        }
    </div>

    <div id="carousel-generic" class="carousel slide" data-ride="carousel">
        <!-- Indicators -->
        <ol class="carousel-indicators" style="bottom: 0px">
            <li data-target="#carousel-generic" data-slide-to="0"></li>
            <li data-target="#carousel-generic" data-slide-to="1"></li>
            <li data-target="#carousel-generic" data-slide-to="2"></li>
        </ol>

        <!-- Wrapper for slides -->
        <div class="carousel-inner">
            @for (var i = 0; i < Model.Count; i++)
            {
                var page = Model[i];
                <div class="item @(i == 0 ? "active" : "")">
                    <table class="corSlideItem">
                        <tr>
                            <td style="width:230px;">
                                <a href="@page.FriendUrl"><img src="@page.Thumbnail" /></a>
                            </td>
                            <td style="padding-top:30px">
                                <div style="line-height:25px">
                                    <b>@(Phatent.Website.WebContext.Language=="zh"?page.Title:page.ETitle)</b>
                                    <span>@page.CreatedOn.ToString("yyyy-MM-dd")</span>
                                </div>
                                <p>
                                    @(Phatent.Website.WebContext.Language=="zh"?page.Abbreviation:page.EAbbreviation)
                                </p>
                            </td>
                        </tr>
                    </table>
                </div>
            }
        </div>
    </div>
    <script>
        $('#carousel-generic').carousel()
    </script>

    <div class="tls">
        <ul class="txtList"></ul>
    </div>
    <div style="text-align: center;">
        <div id="paginator"></div>
    </div>
</div>

<script>
    $("#paginator").bootstrapPaginator({
        currentPage: 1,
        totalPages: 1,
        onPageChanged: function (e, o, n) {
            GetList(n - 1);
        }
    });
    function GetList(pi) {
        var pageSize = 10;
        var lst = Whale.Remote.GetCollection({
            url: "/Home/GetPages",
            parameters: {
                pageSize: pageSize,
                pageIndex: pi,
                caseID: 9
            }
        });

        if (lst != null) {
            var tp = lst.Total / pageSize + (lst.Total % pageSize > 0 ? 1 : 0)
            $("#paginator").bootstrapPaginator({ totalPages: tp });

            var html = "";
            $.each(lst.Data, function (i, o) {
                html += "<li><div class='triangle'></div>";
                 @if (Phatent.Website.WebContext.Language=="zh"){
                    <text>html += "● <a href='" + o.FriendUrl + "'>" + o.Title + "</a>";</text>
                }else{
                    <text>html += "● <a href='" + o.FriendUrl + "'>" + o.ETitle + "</a>";</text>
                }
                html += "<span>"+o.CreatedOn.substr(0,10)+"</span></li>";
            });
            $(".txtList").html(html);
        }
    }
    GetList(0);
</script>



